
def forever:byte = 1

def RAM:byte[65536]				@ 0

def vblank:byte					@ 53266

def xyzrandomseed:byte[] = 1, 1, 0, 0, 1, 0, 3, 3, 3, 2, 1, 2, 2, 2, 2, 2
def randomptr:word

sub copy_memory(from_mem:word, to_mem:word, no_bytes:word) {
	def source:word
	def target:word
	def finished:word

	source = from_mem
	target = to_mem
	finished = from_mem + no_bytes

	while(source < finished) {
		RAM[target] = RAM[source]

		inc source
		inc target
	}
}

def rnd_out:byte

sub reset_not_random() {
	randomptr = 0
}


//sub generate_random_sid(offset:word, nonumbers:word) {
//#asm
//	lda #255
//	sta $d40e
//	sta $d40f
//	lda #128
//	sta $d412
//#endasm
	
//	while(i < nonumbers) {
//		tmp = RAM[54299]



sub get_random_fib(ref number:byte) {
	def tmp:byte
	tmp = xyzrandomseed[randomptr]
	number = tmp

	inc randomptr
	if(randomptr > 20000) {
		call reset_not_random()
	}
}

